# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AdSense.V2.Model.AdUnit do
  @moduledoc """
  Representation of an ad unit. An ad unit represents a saved ad unit with a specific set of ad settings that have been customized within an account.

  ## Attributes

  *   `contentAdsSettings` (*type:* `GoogleApi.AdSense.V2.Model.ContentAdsSettings.t`, *default:* `nil`) - Required. Settings specific to content ads (AFC).
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. Display name of the ad unit, as provided when the ad unit was created.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of the ad unit. Format: accounts/{account}/adclients/{adclient}/adunits/{adunit}
  *   `reportingDimensionId` (*type:* `String.t`, *default:* `nil`) - Output only. Unique ID of the ad unit as used in the `AD_UNIT_ID` reporting dimension.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Required. State of the ad unit.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :contentAdsSettings => GoogleApi.AdSense.V2.Model.ContentAdsSettings.t() | nil,
          :displayName => String.t() | nil,
          :name => String.t() | nil,
          :reportingDimensionId => String.t() | nil,
          :state => String.t() | nil
        }

  field(:contentAdsSettings, as: GoogleApi.AdSense.V2.Model.ContentAdsSettings)
  field(:displayName)
  field(:name)
  field(:reportingDimensionId)
  field(:state)
end

defimpl Poison.Decoder, for: GoogleApi.AdSense.V2.Model.AdUnit do
  def decode(value, options) do
    GoogleApi.AdSense.V2.Model.AdUnit.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AdSense.V2.Model.AdUnit do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
